package cn.liontalk.concurrent.shuati;


import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        String result = sc.nextLine();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < result.length(); i++) {
            char a = result.charAt(i);
            if ((a >= 97 && a <= 122) || (a >= 65 && a <= 90)) {
                sb.append(a);
            } else {
                sb.append(" ");
            }
        }
        String s = sb.toString();
        String[] a = s.split(" ");
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = a.length - 1; i >= 0; i--) {
            stringBuffer.append(a[i] + " ");
        }
        String re = stringBuffer.toString();
        System.out.println(re.substring(0, re.length() - 1));
    }
}
